
package com.nikmesoft.android.alwaysontime.activities;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TabHost;
import android.widget.TextView;

import com.nikmesoft.android.alwaysontime.R;
import com.nikmesoft.android.alwaysontime.daos.TasksDAO;

public class HomeActivity extends BaseActivity
{
	private ImageView imgalarm, imgsms, imgtask;
	private TextView tvnumTask;
	TasksDAO tasksDAO;
	static final int TODAY_TASK = 0;

	@Override
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_home);
		init();
	}

	private void init()
	{	imgalarm = (ImageView) findViewById(R.id.imgalarm);
		imgsms = (ImageView) findViewById(R.id.imgsms);
		imgtask = (ImageView) findViewById(R.id.imgtask);
		tvnumTask = (TextView) findViewById(R.id.tvnumTask);
		tasksDAO.getInstance().getTasks(TODAY_TASK);
		tvnumTask.setText("Task : " +TasksDAO.getInstance().finishcountTasktoday + "/" + TasksDAO.getInstance().countTasktoday);
	}

	public void OnClickHome(View v)
	{	switch (v.getId())
		{	case R.id.imgalarm:
				MainActivity parent = (MainActivity)getParent();
				parent.changeTab(1);
				break;
			case R.id.imgsms:
				((MainActivity)getParent()).changeTab(3);
			break;
			case R.id.imgtask:
				((MainActivity)getParent()).changeTab(2);
				break;
			default:
				break;
		}
	}
	
}
